﻿namespace QingZhouLinYe.HttpApi.Models.Converters
{
    public class Line
    {
        public Point[] line { get; set; }


        public Line(Point[] locations)
        {
            line = locations;
        }

        public override string ToString()
        {
            string linestr = "";
            for (int i = 0; i < line.Count(); i++)
            {
                linestr += line[i].X + " " + line[i].Y + " " + line[i].Z + ",";
            }
            linestr = linestr.Substring(0, linestr.Length - 1);
            return $"LINESTRING (" + linestr + ")";
        }
    }
}
